﻿using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace Plot.Primitives
{
    internal class XYPlot : PShape
    {
        public double Height { get; set; }
        public double Width { get; set; }
        public double AxisDividerDistance { get; set; }

        public XYPlot(double x, double y, double angle, double height, double width) : base(x, y, angle)
        {
            Height = height;
            Width = width;
            AxisDividerDistance = 10d;
        }

        public override IEnumerator<PShape> GetEnumerator()
        {
            var xaxis = new Axis(StartPoint.X, StartPoint.Y, 0d, Width, AxisDividerDistance);
            var yaxis = new Axis(StartPoint.X, StartPoint.Y, -90d, Height, AxisDividerDistance);

            return new ReadOnlyCollection<PShape>(new PShape[] { xaxis, yaxis }).GetEnumerator();
        }
    }
}